#include "UiSWCSwitchWnd.h"

#ifdef MERGER_APP_TO_SHELL
extern HINSTANCE	g_SDHResModuleHandle;
#endif

UiSWCSwitchWnd::UiSWCSwitchWnd()
{
}

UiSWCSwitchWnd::~UiSWCSwitchWnd()
{
}

BOOL UiSWCSwitchWnd::InitUiWin(void)
{
	BOOL bRtn = FALSE;
	LoadiInterItem();
	return bRtn;
}

void UiSWCSwitchWnd::PaintWin(HDC hdc, RECT* prcWin, RECT* prcUpdate)
{
//	m_SwitchWndBG->Draw(hdc, prcWin, false, false);
}

int UiSWCSwitchWnd::OnLButtonDown(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonDown(fwKeys, xPos, yPos);

}

int UiSWCSwitchWnd::OnLButtonUp(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonUp(fwKeys, xPos, yPos);

}

void UiSWCSwitchWnd::LoadiInterItem()
{
//jdhuang 20120818
	
//	m_SwitchWndBG = ImagingHelper::GetImageObject(MzGetInstanceHandle(), 1058);
	RECT rtBtnSwitchWnd[MAX_SWITCH_WND_BTN] = 
	{
		300, 5, 460, 73,
		460, 5, 620, 73,
		620, 5, 780, 73,
	};
	
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetPos(rtBtnSwitchWnd[SWITCH_WND_STEERING].left, rtBtnSwitchWnd[SWITCH_WND_STEERING].top,
					rtBtnSwitchWnd[SWITCH_WND_STEERING].right-rtBtnSwitchWnd[SWITCH_WND_STEERING].left,
					rtBtnSwitchWnd[SWITCH_WND_STEERING].bottom-rtBtnSwitchWnd[SWITCH_WND_STEERING].top);
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetID(6200);
#ifndef MERGER_APP_TO_SHELL
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1002, true));
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1003, true));
#else
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,2002, true));
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,2003, true));
#endif
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetText(L"Steering");
	m_BtnSwitchWnd[SWITCH_WND_STEERING].SetTextColor(RGB(0, 0, 255));	
	AddChild(&m_BtnSwitchWnd[SWITCH_WND_STEERING]);

	m_BtnSwitchWnd[SWITCH_WND_CAR].SetPos(rtBtnSwitchWnd[SWITCH_WND_CAR].left, rtBtnSwitchWnd[SWITCH_WND_CAR].top,
					rtBtnSwitchWnd[SWITCH_WND_CAR].right-rtBtnSwitchWnd[SWITCH_WND_CAR].left,
					rtBtnSwitchWnd[SWITCH_WND_CAR].bottom-rtBtnSwitchWnd[SWITCH_WND_CAR].top);
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetID(6201);
#ifndef MERGER_APP_TO_SHELL
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1002, true));
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1003, true));
#else
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,2002, true));
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,2003, true));
#endif
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetText(L"Car");
	m_BtnSwitchWnd[SWITCH_WND_CAR].SetTextColor(RGB(0, 0, 255));	
	AddChild(&m_BtnSwitchWnd[SWITCH_WND_CAR]);

	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetPos(rtBtnSwitchWnd[SWITCH_WND_AUTO_LOGO].left, rtBtnSwitchWnd[SWITCH_WND_AUTO_LOGO].top,
					rtBtnSwitchWnd[SWITCH_WND_AUTO_LOGO].right-rtBtnSwitchWnd[SWITCH_WND_AUTO_LOGO].left,
					rtBtnSwitchWnd[SWITCH_WND_AUTO_LOGO].bottom-rtBtnSwitchWnd[SWITCH_WND_AUTO_LOGO].top);
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetID(6202);
#ifndef MERGER_APP_TO_SHELL
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1002, true));
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1003, true));
#else
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,2002, true));
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,2003, true));
#endif
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetText(L"Logo");
	m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO].SetTextColor(RGB(0, 0, 255));	
	AddChild(&m_BtnSwitchWnd[SWITCH_WND_AUTO_LOGO]);

}

BOOL UiSWCSwitchWnd::InitImages()
{
	return TRUE;
}
void UiSWCSwitchWnd::DeleteImages()
{
}